<template>
  <div>
    <insurance-analysis  v-if="hasPermission('statistics:data:qushi')"/>
    <AreaPlatformAnalysis />
    <ChannelSalespersonAnalaysis :areaData="areaData" />
    <InsuranceCostsPie :areaData="areaData" />
  </div>
</template>
<script lang="ts" setup>
  import { ref, onMounted } from 'vue';
  import { loadTreeData } from '/@/api/common/api';
  import insuranceAnalysis from './components/InsuranceAnalysis.vue';
  import AreaPlatformAnalysis from './components/AreaPlatformAnalysis.vue';
  import ChannelSalespersonAnalaysis from './components/ChannelSalespersonAnalaysis.vue';
  import InsuranceCostsPie from './components/InsuranceCostsPie.vue';
  import { usePermission } from '/@/hooks/web/usePermission'
  const { hasPermission } = usePermission();

  const areaData = ref<any>([]);
  onMounted(() => {
    loadTreeData({ pcode: 'B04' }).then((res) => {
      if (res) {
        areaData.value = res;
        console.info(areaData.value);
        // 默认展开父节点
        //expandedKeys.value = unref(departTree).map(item => item.id)
      }
    });
  });
</script>

<style lang="less" scoped></style>
